#include "check_soa.h"
void findNameServers(char *domain,char *nsList[],int *nsNum)
{
	union{
		HEADER hdr;
		u_char buf[NS_PACKETSZ];
	} response;
	int responseLen;
	ns_msg 	handle;

	if ((responseLen = 
				res_query(domain,
						  ns_c_in,
						  ns_t_ns,
						  (u_char *)&response,
						  sizeof((response))) <0) {
			nsError(h_errno,domain);
			exit(1);
			}

	if (ns_initparse(response.buf,responseLen,&handle) < 0){
		fprintf(stderr," ns_initparse: %s \n",strerror(errno));
		return ;
	}
	/*
	 *
	 */

	addNameServers(nsList,nsNum,handle,ns_s_an);

	addNameServers(nsList,nsNum,handle,ns_s_ns);
}
